package com.ruoyi.expert.controller;

import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.page.TableDataInfo;
import com.ruoyi.expert.pojo.*;
import com.ruoyi.expert.pojo.vo.ExpertVO;
import com.ruoyi.expert.service.Expertservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;
/**
 *  专家信息 信息操作
 *
 * @author wyp
 */
@RestController
@RequestMapping("/expertC")
public class ExpertController extends BaseController {
    @Autowired
    private Expertservice service;
    /** 专家入库表格信息 */
    @PostMapping("/listexpert")
    public TableDataInfo selectExpert(CsExpert csExpert){
        startPage();
        List<DtExpert> dtExperts = service.selectExpert(csExpert);
        return getDataTable(dtExperts);
    }

    /** 专家入库查看：专家基本信息 */
    @PostMapping("/listexpert01")
    public List<Expert> selectExpert01(Expert expert){
        System.out.println("expert"+expert);
        return service.selectExpert01(expert);
    }

    /** 专家入库查看：任职经历信息 */
    @PostMapping("/listexperience")
    public List<Experience> selectExperience(Experience experience) {
       List<Experience> s=service.selectExperience(experience);
        System.out.println("laplspas"+s);
        return service.selectExperience(experience);
    }

    /** 专家入库查看：教育经历信息 */
    @PostMapping("/listeducate")
    public List<Educate> selectEducate(Educate educate){
        return service.selectEducate(educate);
    }

    /** 专家入库查看：培训经历信息 */
    @PostMapping("/listtraining")
    public List<Training> selectTraining(Training training){
        return service.selectTraining(training);
    }

    /** 专家入库查看：职业信息 */
    @PostMapping("/listoccupation")
    public List<Occupation> selectOccupation(Occupation occupation){
        return service.selectOccupation(occupation);
    }

    /** 专家入库查看：职称信息 */
    @PostMapping("/listjob")
    public List<Job> selectJob(Job job){
        return service.selectJob(job);
    }

    /** 专家入库审核： 通过方法 */
    @PostMapping("/updateexamine")
    public Integer updateExpert(Expert expert){
        return service.updateExpert(expert);
    }

    @GetMapping("/getDialogExpertData")
    public TableDataInfo getDialogExpertData(CsExpert csExpert){
        startPage();
        List<ExpertVO> csExperts=service.getDialogExpertData(csExpert);
        return getDataTable(csExperts);
    }
}
